package com.javachmapi.seckill.mapper;


import com.javachmapi.seckill.entity.Order;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.data.repository.query.Param;

/**
 * 下单mapper
 */
@Mapper
public interface SeckillMapper {

    /**
     * 下单时商品库存减一
     * @param goodsId
     * @return
     */
    public int reduceGoodsStockById(@Param("goodsId") String goodsId);

    /**
     * 插入下单记录
     * @param order
     */
    public void insertOrder(Order order);

    /**
     * 根据订单id查询该订单是否是未支付状态
     * @param orderId
     * @return
     */
    public Order selectNoPayOrderById(String orderId);

    /**
     * 更新支付状态
     * @param
     */
    public void updatePayStatus(Order order);
}
